<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "" "">
<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:w="http://www.apusic.com/jsf/widget" xmlns:layout="http://www.apusic.com/jsf/layout"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:ajax="http://www.apusic.com/jsf/ajax"
	renderKitId="AJAX" xmlns:epm="http://www.bp.com.cn/epm">
	<w:head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<w:script src="/dwr/interface/dwrService.js" type="text/javascript" language="UTF-8"></w:script>
		<w:script src="/dwr/engine.js" type="text/javascript" language="UTF-8"></w:script>
		<w:stylesheet src="/css/kmp4.css" type="text/css"></w:stylesheet>
		<w:script src="/javascript/k4.js" type="text/javascript" language="UTF-8"></w:script>
		<script>
		function chanageCommonKeyType(){
		     dwrService.isLay(keyTypeJsv.value,doreturnLay);
		}
	  function doreturnLay(flag){
	        if(flag){ 
			var content=   document.getElementById('parentIdContent');
		    content.style.display='block';
		    var title=	 document.getElementById('parentIdTitle');
		    title.style.display='block';
		     
			var url="javascript:openKeywordSelectWindow(window,'/component/commonKeyTree.faces?keyType="+keyTypeJsv.value+"',parentId_jsvar,parentId_name_jsvar)";
	        var oo=document.getElementById("parentId_link");
	   	    oo.href=url; 
		 }else{ 
		  	if(keyTypeJsv.value=='showType'){
		     var content=   document.getElementById('typeDescription');
		    content.style.display='block';
		    var title=	 document.getElementById('typeDescriptionContent');
		    title.style.display='block'; 
		    var freeItemTitle=document.getElementById('freeItemTitle');
		    freeItemTitle.style.display='block';
		    var freeItemContent=document.getElementById('freeItemContent');
		    freeItemContent.style.display='block';
		  	} 
		  
		  }
		} 
		</script>
	</w:head>
	<w:page title="编辑配置项">
		<layout:panel border="false" autoHeight="true" autoWidth="true" styleClass="k4-form">
			<w:form clientValidate="true">
				<layout:panel border="false" autoHeight="true" autoWidth="true" styleClass="k4-form-toolbar">
					<w:toolBar>
						<w:button label="保存" id="saveCommonKey"
							image="#{facesContext.externalContext.requestContextPath}/images/save.gif" />
						<w:separator />
						<w:button label="取消" id="addCancel"
							image="#{facesContext.externalContext.requestContextPath}/images/cancel.gif" immediate="true"
							onclick="javascript:closeCenterLayoutTab('editCommonKeyTab')" alwaysSubmit="false" />
					</w:toolBar>
				</layout:panel>
				<layout:panelGrid columns="2" cellpadding="0" cellspacing="0" border="1"
					styleClass="k4-form-grid">
					<layout:cell styleClass="k4-form-fieldtitle">
						<h:outputLabel value="配置项值" for="keyValue" />
						<h:inputText id="id" style="display: none;"></h:inputText>
					</layout:cell>
					<layout:cell styleClass="k4-form-fieldvalue">
						<w:textField styleClass="k4-form-textfield" id="keyValue" allowBlank="false" required="true"></w:textField>
					</layout:cell>
					<layout:cell styleClass="k4-form-fieldtitle">
						<h:outputLabel value="配置项简称" for="shortCommonKeyValue" />
					</layout:cell>
					<layout:cell styleClass="k4-form-fieldvalue">
						<w:textField styleClass="k4-form-textfield" id="shortCommonKeyValue" maxLength="50"
							requiredTrim="true"></w:textField>
					</layout:cell>
					<layout:cell styleClass="k4-form-fieldtitle">
						<h:outputLabel value="配置项类型" for="keyValue" />
					</layout:cell>
					<layout:cell styleClass="k4-form-fieldvalue">
						<w:combo styleClass="k4-form-textfield" id="keyType" jsvar="keyTypeJsv" allowBlank="false"
							required="true" editable="false" onchange="chanageCommonKeyType()"></w:combo>
					</layout:cell>
					<layout:cell styleClass="k4-form-fieldtitle">
						<div id="freeItemTitle" style="#{modules.system.webadmin.editCommonKeyBean.freeItemStyle}">
						<h:outputLabel value="专家类别" for="freeItem1" /></div>
					</layout:cell>
					<layout:cell styleClass="k4-form-fieldvalue">
						<div id="freeItemContent" style="#{modules.system.webadmin.editCommonKeyBean.freeItemStyle}">
						<w:combo id="freeItem1" styleClass="k4-form-textfield" emptyText="请选择">
						</w:combo></div>
					</layout:cell>
					<layout:cell styleClass="k4-form-fieldtitle" id="parentIdTitle">
						<div id="parentIdTitle" style="#{modules.system.webadmin.editCommonKeyBean.parentIdStyle}">
						<h:outputLabel value="所属级别" for="keyType" /></div>
						<div id="typeDescription" style="#{modules.system.webadmin.editCommonKeyBean.freeItemStyle}">
						<h:outputLabel value="统计显示字段" for="typeDescription" /></div>
					</layout:cell>
					<layout:cell styleClass="k4-form-fieldvalue">
						<div id="parentIdContent" style="#{modules.system.webadmin.editCommonKeyBean.parentIdStyle}">
						<epm:ckSingleSelect idField="parentId"
							keyType="#{modules.system.webadmin.editCommonKeyBean.keyType}"></epm:ckSingleSelect></div>
						<div id="typeDescriptionContent"
							style="#{modules.system.webadmin.editCommonKeyBean.freeItemStyle}"><w:combo
							id="typeDescription" styleClass="k4-form-textfield" emptyText="请选择">
						</w:combo></div>
					</layout:cell>
					<layout:cell styleClass="k4-form-fieldtitle">
						<h:outputLabel value="是否有效" for="enabled" />
					</layout:cell>
					<layout:cell styleClass="k4-form-fieldvalue">
						<w:combo style="k4-form-modifield" id="enabled" allowBlank="false" required="true">
						</w:combo>
					</layout:cell>
					<layout:cell styleClass="k4-form-fieldtitle">
						<h:outputLabel value="是否可选" for="checkEnable" />
					</layout:cell>
					<layout:cell styleClass="k4-form-fieldvalue">
						<w:combo style="k4-form-modifield" id="checkEnable" allowBlank="false" required="true">
						</w:combo>
					</layout:cell>
					<layout:cell styleClass="k4-form-fieldtitle">
						<h:outputLabel value="序号" for="indexNumber" />
					</layout:cell>
					<layout:cell styleClass="k4-form-fieldvalue">
						<w:textField styleClass="k4-form-textfield" id="indexNumber" allowBlank="false"
							required="true"></w:textField>
					</layout:cell>
				</layout:panelGrid>
			</w:form>
		</layout:panel>
	</w:page>
</f:view>